﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Rsa
{
    /// <summary>
    /// Interaction logic for JanelaFacebook.xaml
    /// </summary>
    public partial class JanelaFacebook : UserControl
    {
        GestorConfigXML Gxml = null;
        private List<Lista> ListaFacebook = new List<Lista>();
        private LancarThreads _lancar = null;
        private GestorFacebook face;

        public JanelaFacebook(GestorConfigXML gx)
        {
            InitializeComponent();
            Gxml = gx;
          //  listaBox.Items.Add(new Lista("ola", "Teste Facebook", "../../imagens/facebook.png"));
        }

        public void atualizarFacebook(List<Lista> myLista) {

           
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            face = new GestorFacebook(Gxml);
            face.Dados(1);
            
        }
        public LancarThreads Lancar {
            get { return _lancar; }
            set {
                _lancar = value;
                Lancar.facebookEvento += new LancarThreads.FacebookHandler(atualizarFacebook);
            }
        }

        private void listaBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {

        }

        private void button1_Click_1(object sender, RoutedEventArgs e)
        {
            face = new GestorFacebook(Gxml);
            if (textBox1.Text != null){

                if (face.Post(textBox1.Text))
                    textBox1.Text = "";
            }
 
        }

        private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {

        }

    
    }
}
